import { createRouter, createWebHistory } from 'vue-router'
import Home from '../views/Home.vue'
import Users from '../views/Users.vue'
import Products from '../views/Products.vue'
import Orders from '../views/Orders.vue'
import ConfigApplication from '../views/configCenter/application/index.vue'
import DbEditor from '../views/dbEditor/index.vue'

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/users',
    name: 'Users',
    component: Users
  },
  {
    path: '/products',
    name: 'Products',
    component: Products
  },
  {
    path: '/orders',
    name: 'Orders',
    component: Orders
  },
  {
    path: '/detail',
    name: 'DetailPage',
    component: () => import('../views/DetailPage.vue')
  },
  {
    path: '/config-center/application',
    name: 'ConfigApplication',
    component: ConfigApplication
  },
  {
    path: '/db-editor',
    name: 'DbEditor',
    component: DbEditor
  },
  {
    path: '/datasource-management',
    name: 'DataSourceManagement',
    component: () => import('../views/database/DataSourceManagement.vue')
  },
  {
    path: '/database-management',
    name: 'DatabaseManagement',
    component: () => import('../views/database/DatabaseManagement.vue')
  },
  {
    path: '/table-management',
    name: 'TableManagement',
    component: () => import('../views/database/TableManagement.vue'),
    meta: { title: '表管理' }
  },
  {
    path: '/data-domain-management',
    name: 'DataDomainManagement',
    component: () => import('../views/database/DataDomainManagement.vue'),
    meta: { title: '数据域管理' }
  },
  {
    path: '/data-dictionary-management',
    name: 'DataDictionaryManagement',
    component: () => import('../views/database/DataDictionaryManagement.vue'),
    meta: { title: '数据字典管理' }
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router